//
//  ComplainsRecordsCell.m
//  NtoccShipper
//
//  Created by mac on 2019/11/22.
//  Copyright © 2019 zhuchongjin. All rights reserved.
//

#import "ComplainsRecordsCell.h"

@interface ComplainsRecordsCell()
// Complains
//@property (nonatomic,strong) CJLabel *labComplainer;
@property (nonatomic,strong) CJLabel *labComplainsTime;
//@property (nonatomic,strong) CJLabel *labGoodsNum;
//@property (nonatomic,strong) CJLabel *labDriveingNum;
@property (nonatomic,strong) CJLabel *labName;
@property (nonatomic,strong) CJLabel *labState;
@property (nonatomic,strong) CJLabel *labPhone;
@property (nonatomic,strong) CJLabel *labAdress;
@property (nonatomic,strong) UIView *viewData;
@end

@implementation ComplainsRecordsCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setCellInfoWithModel:(ComplainsRecordsModel *)model withtype:(NSString *)str{
    
    self.labComplainsTime.text = model.gmtCreated;
    
    if ([str isEqualToString:@"0"]) {
        self.labName.text = model.driverName;
        self.labPhone.text = [CJControl replaceStringWithAsterisk:model.driverPhone startLocation:3 lenght:4];
    }else{
        self.labName.text = model.driverName;
        self.labPhone.text = [CJControl replaceStringWithAsterisk:model.driverPhone startLocation:3 lenght:4];
    }
    
    if (model.isHandle == 1) {
        self.labState.text = @"已处理";
        self.labState.textColor = [UIColor cjMainColorText];
        self.viewData.backgroundColor = [CJControl getUIWithNew] ?  [[UIColor cjMainColor]colorWithAlphaComponent:0.2] : [UIColor cjClearColor];
    
    }else if(model.isHandle == 0){
        self.labState.text = @"处理中";
        self.labState.textColor = CJRGB16Color(0xFB6243);
        self.viewData.backgroundColor = [CJControl getUIWithNew] ?  [CJRGB16Color(0xFB6243) colorWithAlphaComponent:0.2] : [UIColor cjClearColor];
    }
    
    self.labAdress.text = model.address;
    self.labAdress.hidden = [CJRegular getIsStrEmpty:model.address] ? YES:NO;
    self.labComplainsTime.textAlignment = [CJControl getUIWithNew] ? NSTextAlignmentRight:NSTextAlignmentLeft;

}


@end
